import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/dataMain',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/dataMain/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/dataMain',
    method: 'put',
    data
  })
}

export function getById(data) {
  return request({
    url: 'api/dataMain/getById',
    method: 'post',
    data:{id:data}
  })
}

export function getMaterialTree(params) {
  return request({
    url: 'api/dataMain/getMaterialTree',
    method: 'get',
    params
  })
}

export function editProductParameter(data) {
  return request({
    url: 'api/dataMain/productParameter',
    method: 'put',
    data
  })
}

export default { add, edit, del,getById,getMaterialTree,editProductParameter }
